package com.yunkeji.dao.mapper;

import com.yunkeji.common.core.mapper.BaseMapperPlus;
import com.yunkeji.dao.domain.AppUserVip;
import com.yunkeji.dao.vo.AppUserWalletVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 用户钱包信息Mapper接口
 *
 * @author 老张
 * @date 2024-05-27
 */
public interface AppUserVipMapper
        extends BaseMapperPlus<AppUserVipMapper, AppUserVip, AppUserWalletVo> {

    @Select(
            "SELECT "
                    + " *  "
                    + "FROM "
                    + " ykj_app_user_vip  "
                    + "WHERE "
                    + " common_vip_flag = 1  "
                    + " AND common_vip_expire_time BETWEEN #{before}  "
                    + " AND #{after}")
    List<AppUserVip> selectExpireCommonVip(@Param("before") Date date1, @Param("after") Date date2);

    @Select(
            "SELECT "
                    + " *  "
                    + "FROM "
                    + " ykj_app_user_vip  "
                    + "WHERE "
                    + " exclusive_vip_flag = 1  "
                    + " AND exclusive_vip_expire_time BETWEEN #{before}  "
                    + " AND #{after}")
    List<AppUserVip> selectExpireExclusiveVip(
            @Param("before") Date date1, @Param("after") Date date2);
}
